<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
 <div id="app">
    <my-cpn></my-cpn>
    <my-cpn></my-cpn>
    <my-cpn></my-cpn>
    <my-cpn></my-cpn>
  </div>


     <script src="../js/vue.js"></script>
     <script>
       //1 创建组件构造器
       const cpn=Vue.extend({
         template:`
            <div>
              <h2>我是标题</h2>
              <p>我是哈哈哈哈哈哈</p>
            </div>
         `
       })
       //2注册组件
       Vue.component('my-cpn',cpn)
       const app=new Vue({
         el: '#app',
         data: {
           message:'你好vue',
         }
       })
     </script>
</body>
</html>